package com.jialea.springboot.controller;

import cn.dev33.satoken.stp.StpUtil;
import com.jialea.springboot.annotation.RepeatSubmit;
import com.jialea.springboot.common.result.Result;
import com.jialea.springboot.model.dto.system.UserDto;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: wf
 * @created: 2024/8/25 18:33
 */

@RestController
@RequestMapping("/user")
public class SysUserController {

    @PostMapping("/login")
    public Result login() {
        StpUtil.login(1L);
        return Result.success("登录成功");
    }

    @RepeatSubmit
    @PostMapping("/addUser")
    public Result addUser(@RequestBody UserDto userDto){
        System.out.println(userDto);
        return Result.success(userDto);
    }
}
